package scaladay2

import scala.collection.mutable.Map
object MapDemo {
  def main(args: Array[String]): Unit = {
    val stringToInt = Map("Tom" -> 45, "jerry" -> 76, "hi" -> 34)
    val stringToInt2 = Map(("Tom", 45), ("jerry", 76), ("hi", 34))

    println(stringToInt)
    println(stringToInt2)

    println(stringToInt("Tom") = 4545)

    println(stringToInt("Tom"))
    println(stringToInt.get("Tom"))
    println(stringToInt.getOrElse("Tom", 1111))
    println(stringToInt.getOrElse("Tomq", 1111))

    stringToInt += ("yy"->555, "nn"->666)
    stringToInt += (("yy",555), ("nn",666))

    println(stringToInt)
    println(stringToInt2)


  }
}
